Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve call validation by checking validation of form using native html input before changing step #850

Merged
merged 9 commits into from
Nov 26, 2024

Conversation

bolmsten
Copy link
Contributor

@bolmsten bolmsten commented Nov 8, 2024

Description

This PR improves call validation by checking the validation of the form using native HTML input before changing the step.

Motivation and Context

This change is necessary to ensure the user has correctly filled out the form before proceeding to the next step. This will prevent submission of incomplete or incorrect data, improving the overall user experience and data integrity.

Changes

  • The handleStep function in MultistepWizard.tsx is now async and checks the validity of the form before proceeding.
  • If the form is invalid, it will report validity and stop the function.
  • The text on the 'Next' button has been changed to 'Save and Continue' to better reflect its function.

How Has This Been Tested?

Fixes Jira Issue

https://jira.esss.lu.se/browse/swap-4128

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@bolmsten bolmsten requested a review from a team as a code owner November 8, 2024 13:45
@bolmsten bolmsten requested review from mehta-pooja123 and janosbabik and removed request for a team November 8, 2024 13:45
Copy link
Contributor

@janosbabik janosbabik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just small a suggestion from my side.

@@ -51,9 +51,17 @@ export const Wizard = ({
setStepNumber(Math.max(stepNumber - 1, 0));
};

const handleStep = (step: number, values: FormikValues) => () => {
const handleStep = (stepIndex: number, values: FormikValues) => async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const handleStep = (stepIndex: number, values: FormikValues) => async () => {
const handleStep = (stepIndex: number, values: FormikValues) => () => {

@bolmsten bolmsten merged commit f31bdb3 into develop Nov 26, 2024
19 checks passed
@bolmsten bolmsten deleted the swap-4128 branch November 26, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants